home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / pgm_tool / lu62 / debug / getdcwd.asm < prev    next >
Assembly Source File  |  1995-07-03  |  2KB  |  60 lines

  1. ;**********************************************************
  2. ;*                                                        *
  3. ;*         Get_DireCtory_With_Drive                       *
  4. ;*                                                        *
  5. ;* Input:     DS:SI points to buffer                      *
  6. ;* Output:    In AX length of full path name              *
  7. ;*                                                        *
  8. ;* Last modification: 93-02-01 15:15.                     *
  9. ;*                                                        *
  10. ;*                                                        *
  11. ;*  CopyRight 1995. Nicholas Poljakov all rights reserved.*
  12. ;*                                                        *
  13. ;**********************************************************
  14. .DOSSEG
  15. .MODEL SMALL
  16.  
  17. include c:\m61\include\dos.inc
  18. include c:\m61\include\bios.inc
  19. include c:\m61\include\macros.inc
  20.  
  21. PUBLIC   GetDcWD
  22.  
  23. .CODE
  24. GetDcWD  PROC
  25.      @SaveRegs ds,si,es,bx,di,cx,dx,ax,bp
  26.          mov   bp, sp
  27.  
  28.          @GetDrv
  29.          mov   dl, al   ; save current drive number
  30.          add   al, 41h
  31.          mov   BYTE PTR [si], al
  32.          inc   si
  33.          mov   BYTE PTR [si], ':'
  34.          inc   si
  35.          mov   BYTE PTR [si], '\'
  36.          inc   si
  37.  
  38.          inc   dl
  39.          mov   ah, 47h  ; get current path
  40.          int   21h      ; in buffer points DS:SI
  41.  
  42.          dec   si
  43.          dec   si
  44.          dec   si
  45.          mov   dx, si   ; save initial value of pointer
  46. Sk0:
  47.          lodsb
  48.          and   al, al
  49.          jnz   Sk0
  50.  
  51.          sub   si, dx   ; length of var. current_directory_name + 1
  52.          dec   si
  53.          mov   WORD PTR [bp + 2], si ; set return value of AX
  54.  
  55.      @RestoreRegs
  56.          ret
  57. GetDcWD  ENDP
  58.  
  59.          END
  60.